import React from 'react';
import './index.css';
export default class UnlockPayment extends React.Component{
    constructor(props){
        super();
        let leftBorder=<div ></div>;
        let rightBorder=<div ></div>;
        if(props.notShowBorder===undefined ||
            props.notShowBorder===null){
                leftBorder=<div className="UnlockPayment_Left_Hengxian"></div>;
                rightBorder=<div className="UnlockPayment_Right_Hengxian"></div>;
        }else{
            this.setState({
                leftBorder:<div>1</div>,
                rightBorder:<div>2</div>,
            })
        }

        this.state={
            type:props.type,
            lefttext:props.lefttext,
            righttext:props.righttext,
            leftBorder:leftBorder,
            rightBorder:rightBorder,
            src:props.src
        }
        
    }
    // 解锁课件--立即支付
    render(){
        return(
            <div className="UnlockPayment_Body">
                <div className={this.state.type==="1"?"UnlockPayment_Left UnlockPayment_Left_other":"UnlockPayment_Left"}>
                    {this.state.leftBorder}
                    <div>{this.state.lefttext}</div>
                    {this.state.rightBorder}
                </div>
                <a href={this.state.src} target="_parent">
                    <div className="UnlockPayment_Right" style={{display:this.state.type==="1"?"none":"block"}}>
                        {this.state.righttext}
                    </div>
                </a>
                
            </div>
        );
    }
    
}